<?php

/**
 * OntoWiki usage module template
 *
 * @version $Id: usage.phtml 3392 2009-06-26 12:41:00Z sebastian.dietzold $
 */

?>
<?php if (!empty($this->instances) or !empty($this->objects)): ?>
    <ul class="bullets-none separated">
        <?php if (!empty($this->instances)): ?>
            <li class="has-contextmenu-area">
                <div class="contextmenu">
                    <a class="item"
                       href="<?php echo $this->subjectListLink ?>">
                            <span class="icon icon-list" title="Show as List">
                                    <span>Show as List</span>
                            </span>
                    </a>
                </div>
                <?php echo $this->_('Subjects') ?>
            	<ul class="inline separated">
                    
            	    <?php $i = 0; ?>
            	    <?php foreach ($this->instances as $instance): ?>
            	        <?php if (++$i == count($this->instances)): ?>
            	            <li class="last-child"><a class="hasMenu" about="<?php echo $instance['uri'] ?>" href="<?php echo $instance['url'] ?>"><?php echo $instance['title'] ?></a></li>
            	        <?php else: ?>
            	            <li><a class="hasMenu" about="<?php echo $instance['uri'] ?>" href="<?php echo $instance['url'] ?>"><?php echo $instance['title'] ?></a></li>
            	        <?php endif; ?>
            	    <?php endforeach; ?>
            	</ul>
        	</li>
    	<?php endif; ?>
    	<?php if (!empty($this->objects)): ?>
        	<li class="has-contextmenu-area">
        	    <div class="contextmenu">
                        <a class="item"
                           href="<?php echo $this->objectListLink ?>">
                                <span class="icon icon-list" title="Show as List">
                                        <span>Show as List</span>
                                </span>
                        </a>
                    </div>
                <?php echo $this->_('Objects') ?>
            	<ul class="inline separated">
                    <div class="contextmenu">
                        <a class="item"
                           href="<?php echo $this->subjectListLink ?>">
                                <span class="icon icon-list" title="Show as List">
                                        <span>Show as List</span>
                                </span>
                        </a>
                    </div>
            	    <?php $i = 0; ?>
            	    <?php foreach ($this->objects as $object): ?>
            	        <?php if (++$i == count($this->objects)): ?>
            	            <li class="last-child"><a class="hasMenu" about="<?php echo $object['uri'] ?>" href="<?php echo $object['url'] ?>"><?php echo $object['title'] ?></a></li>
            	        <?php else: ?>
            	            <li><a class="hasMenu" about="<?php echo $object['uri'] ?>" href="<?php echo $object['url'] ?>"><?php echo $object['title'] ?></a></li>
            	        <?php endif; ?>
            	    <?php endforeach; ?>
            	</ul>
            </li>
        <?php endif; ?>
    </ul>
<?php else: ?>
	<p class="messagebox info"><?php echo $this->_($this->message) ?></p>
<?php endif; ?>
